// --------------------- 1. MULTIPLICITY ------------------------ //
//// dcTaL0-1-2 -- DCs downstream of the dipole magnet //////////////
// dcTaL0
etf->Draw("Length$(dcTaL0X0)>>h(13, -1.5, 11.5)");
etf->Draw("Length$(dcTaL0X1)>>h(13, -1.5, 11.5)");
etf->Draw("Length$(dcTaL0Y0)>>h(13, -1.5, 11.5)");
etf->Draw("Length$(dcTaL0Y1)>>h(13, -1.5, 11.5)");
// dcTaL1
etf->Draw("Length$(dcTaL1X0)>>h(13, -1.5, 11.5)");
// dcTaL2
etf->Draw("Length$(dcTaL2X0)>>h(13, -1.5, 11.5)");
//// PDCU0-1--D0-1 -- DCs around the target ////////////////
// tstop4U, tstop4D
etf->Draw("Length$(tstop4U)>>h(10, -1.5, 8.5)");
etf->Draw("Length$(tstop4D)>>h(10, -1.5, 8.5)");
// track
etf->Draw("Length$(preTaLTracker3D)>>h(10, -1.5, 8.5)");
etf->Draw("Length$(taLTracker3D)>>h(10, -1.5, 8.5)");
// --------------------- 1. MULTIPLICITY ------------------------ //

// ------------- 2. FIRED WIRE/Strip DISTRIBUTION ---------------- //
// for DCs
etf->Draw("dcTaL0X0.GetWireId()>>h(43, -1.5, 41.5)");
etf->Draw("dcTaL0X1.GetWireId()>>h(43, -1.5, 41.5)");
// ------------- 2. FIRED WIRE/Strip DISTRIBUTION ---------------- //

// ------------- 3. Drift Time DISTRIBUTION ---------------- //
// for DCs
etf->Draw("dcTaL0X0.GetT()>>h(500, -100., 400.)");
etf->Draw("dcTaL0X1.GetT()>>h(500, -100., 400.)");
// ------------- 3. Drift Time DISTRIBUTION ---------------- //

// ------------- 4. Drift Distance DISTRIBUTION ---------------- //
etf->Draw("dcTaL0X0.GetR()>>h(500, -1.5, 6.5)");
// ------------- 4. Drift Distance DISTRIBUTION ---------------- //

// ------------- 5. Fired Channel DISTRIBUTION ---------------- //
etf->Draw("tchpxi.GetChannelId()>>h(5001, -0.5, 4000.5)");
etf->Draw("tchvme.GetChannelId()>>h(1501, 7499.5, 9000.5)");
// ------------- 5. Fired Channel DISTRIBUTION ---------------- //

// ------------- 6. TOT v.s. chid DISTRIBUTION ---------------- //
// etf->Draw("tchvme.GetTOT():tchvme.GetChannelId()>>h(1501, 7499.5, 9000.5, 500, -100., 700.)",
// "tchvme.GetNofLeadingEdges()!=0&&tchvme.GetNofTrailingEdges()!=0");
etf->Draw("tchvme.GetTOT():tchvme.GetChannelId()>>h(1501, 7499.5, 9000.5, 500, -100., 700.)", "tchvme.GetNofLeadingEdges()!=0&&tchvme.GetNofTrailingEdges()!=0", "col");
etf->Draw("tchpxi.GetTOT():tchpxi.GetChannelId()>>h(5001, -0.5, 4000.5, 500, -100., 700.)", "tchpxi.GetNofLeadingEdges()!=0&&tchpxi.GetNofTrailingEdges()!=0", "col");
// Time To Trig
etf->Draw("tchpxi.GetLeadingEdge():tchpxi.GetChannelId()>>h(5001, -0.5, 4000.5, 500, -100., 700.)", "tchpxi.GetNofLeadingEdges()!=0", "col");
etf->Draw("tchpxi.GetTrailingEdge():tchpxi.GetChannelId()>>h(5001, -0.5, 4000.5, 500, -100., 700.)", "tchpxi.GetNofTrailingEdges()!=0", "col");
// ------------- 6. TOT v.s. chid DISTRIBUTION ---------------- //

// ------------- 7. NofEdges v.s. chid DISTRIBUTION ---------------- //
etf->Draw("tchpxi.GetNofLeadingEdges():tchpxi.GetChannelId()>>h(5001, -0.5, 4000.5, 8, -1.5, 6.5)", "", "col");
etf->Draw("tchvme.GetNofLeadingEdges():tchvme.GetChannelId()>>h(1501, 7499.5, 9000.5, 8, -1.5, 6.5)", "", "col");
etf->Draw("tchpxi.GetNofLeadingEdges()-tchpxi.GetNofTrailingEdges():tchpxi.GetChannelId()>>h(5001, -0.5, 4000.5, 9, -4.5, 4.5)", "", "col");
etf->Draw("tchvme.GetNofLeadingEdges()-tchvme.GetNofTrailingEdges():tchvme.GetChannelId()>>h(1501, 7499.5, 9000.5, 9, -4.5, 4.5)", "", "col");
// ------------- 7. NofEdges v.s. chid DISTRIBUTION ---------------- //

// ------------- 8. PXI Section Length DISTRIBUTION ---------------- //
etf->Draw("PXISection.GetSectionLength()>>h(500, 0., 500.)");
// ------------- 8. PXI Section Length DISTRIBUTION ---------------- //

// ------------- 9. PXI Section Length DISTRIBUTION ---------------- //
etf->Draw("preTaLTrackerX->GetK()>>h(500, -0.1, 0.1)");
// ------------- 9. PXI Section Length DISTRIBUTION ---------------- //

// ------------- 10. Hit Position DISTRIBUTION ---------------- //
// dcTaL0-1; NOTE that only dcTaL0-1, TA (i.e. the tested plastic scintillator), and tstopU are available
string d;
string d = "dcTaL0"; etf->Draw("preTaLTracker3D.GetHitPosY(d):preTaLTracker3D.GetHitPosX(d)>>h(500, -400., 400., 500, -400., 400.)", "", "col");
string d = "dcTaL1"; etf->Draw("preTaLTracker3D.GetHitPosY(d):preTaLTracker3D.GetHitPosX(d)>>h(500, -400., 400., 500, -400., 400.)", "", "col");
string d = "TA"; etf->Draw("preTaLTracker3D.GetHitPosY(d):preTaLTracker3D.GetHitPosX(d)>>h(500, -400., 400., 500, -400., 400.)", "", "col");
string d = "tstop4U"; etf->Draw("preTaLTracker3D.GetHitPosY(d):preTaLTracker3D.GetHitPosX(d)>>h(500, -400., 400., 500, -400., 400.)", "", "col");
// dcTaL2-3
string d = "dcTaL2"; etf->Draw("preTaLTracker3D.GetHitPosY(d):preTaLTracker3D.GetHitPosX(d)>>h(500, -400., 400., 500, -400., 400.)", "", "col");
string d = "dcTaL3"; etf->Draw("preTaLTracker3D.GetHitPosY(d):preTaLTracker3D.GetHitPosX(d)>>h(500, -400., 400., 500, -400., 400.)", "", "col");
string d = "TA"; etf->Draw("preTaLTracker3D.GetHitPosY(d):preTaLTracker3D.GetHitPosX(d)>>h(500, -400., 400., 500, -400., 400.)", "", "col");
string d = "tstop4D"; etf->Draw("preTaLTracker3D.GetHitPosY(d):preTaLTracker3D.GetHitPosX(d)>>h(500, -400., 400., 500, -400., 400.)", "", "col");
// ------------- 10. Hit Position DISTRIBUTION ---------------- //

// ------------- 12. Tracking chi DISTRIBUTION ---------------- //
etf->Draw("dcTaL0X0->GetChi()>>h(500, -1., 1.)");
// STR
etf->Draw("dcTaL0X0->GetR()+dcTaL0X0->GetChi():dcTaL0X0->GetT()>>h(500, -100., 400., 500, -1., 6.)");
// chi-t
etf->Draw("dcTaL0X0->GetChi():dcTaL0X0->GetT()>>h(500, -100., 400., 500, -1., 6.)");
// fit STR using exp data
h->ProfileX("pfx1"); pfx1->Fit("pol7", "R", "", 0., 350.);
// then collect the fitted parameters to the code













// --------------- THE END ------------------- //
